All Questions
Tagged with asp.net-mvcentity-framework
40 questions
9votes
3answers
931views
Creating a round robin MySQL connection manager
Background I am working on an e-commerce website, my web server is written in ASP.NET MVC (C#, EF6) and I am using 3 instances of MySQL DB. These DBs are in a cluster (Galera Cluster) and they are ...
1vote
1answer
71views
Using nullable properties in a base class for record selection in Table per Hierarchy
I want to be able to list every Transaction associated with a Client in date order. ...
1vote
1answer
194views
ASP.NET MVC 5, EF 6 filter performance
I'm creating a filter with Linq in an ASP.NET MVC application. I was hoping I could get some tips on performance enhancements, aside from any possible performance enhancements. I have a few questions:...
4votes
1answer
991views
Initializing entity framework context in constructor
We use the architecture shown in the code below to initialize the DB context for our MVC 5 project using entity framework 6 We have the following questions related to it: Is it safe to initialize the ...
1vote
1answer
175views
Authorization using Entity Framework in ASP.NET MVC
1. Backstory I recently starting programming and I found out that Entity Framework works perfect for my small-sized applications due its simplicity. I've made my custom authorize attribute for MVC ...
3votes
1answer
2kviews
Dynamic AuthorizeAttribute with database
I want to create a AuthorizeAttribute that gets the current ActionMethodRouteData and ...
2votes
1answer
4kviews
Adding or updating Company entity
Here I am trying to post a company view-model and update and insert according. But I feel I am writing it in wrong way or maybe there's a better approach. Here's my code ...
1vote
1answer
392views
Calculating difference in time
In table first value I have value with datatype = Start I need to calculate difference first value - midnight Last value is ...
0votes
1answer
3kviews
use Identity value in entity after insert in Database [closed]
i want to generate value using current date and ID of inserted entity problem is that ID value not generated until insert object to database, so i use this code for generate value: ...
1vote
1answer
177views
Performance concerns for synchronous action methods
I have an ASP.NET MVC 5 application using Entity Framework with SQL Server 2016. The application is mainly basic CRUD. The boilerplate generated when creating the project in Visual Studio did not have ...
2votes
1answer
2kviews
Entity Framework - Table structure, navigating many descendants, etc
Someone suggested to try asking this here instead of stackoverflow, so I'm taking their advice. So I'm rewriting a dated application and trying to structure things the right way. I have a Category > ...
2votes
1answer
1kviews
Counting matching rows in IQueryable
I'm designing a basic ticketing system using ASP.NET MVC with Entity Framework. I'm passing a DbSet<TicketModel> into a method as an ...
2votes
1answer
2kviews
Retrieving values from Entity Framework DbContext to render in a ListBox
I need to pass a ViewModel to a strongly typed View which will display a multiple-select box using Html.ListBoxFor. My ViewModel has a ...
4votes
1answer
790views
Wrappers For Performing SQL Transactions
I am trying to make my ASP.NET MVC application use transactions for all database operations, to ensure safety when there are multiple users. To do this, I have created static methods in my ...
3votes
2answers
359views
linq.Any() check on large database
Is there a way to speed up the Linq.Any check or perform the check in another way to enhance performance. I have a mastercodes table that records unique codes for a campaign. The code below will ...